/////
#include "../reposize.cc"

// clang++ -std=c++11 reposize_test.cc
// -fsanitize=address -fno-omit-frame-pointer
#include <cstdio>
#include <cstring>
int main(int argc, char const *argv[]) {
  if (argc < 2) {
    fprintf(stderr, "usage: %s dir ...\n", argv[0]);
    return 1;
  }
  int i = 1;
  for (; i < argc; i++) {
    int64_t sz = 0;
    if (!gitee::CalculateRepoSize(argv[i], sz)) {
      fprintf(stderr, "unable parse repo size: %s %s\n", argv[i],
              strerror(errno));
      continue;
    }
    double dsz = (double)sz / 1048576.00; // MB
    fprintf(stderr, "%s: %4.2f MB\n", argv[i], dsz);
  }
  return 0;
}
